package com.guojian.common.reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Test {

	public static void main(String[] args) {

		try {
			Class<?> c = Test2.class;
			Constructor<?> cons = c.getConstructor(String.class, String.class);
			System.out.println(cons);

			AbsTest1 a = (AbsTest1) cons.newInstance("guojian", "21");

			System.out.println(a.getInfo());

		} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
			e.printStackTrace();
		}

	}
}
